package com.chenl.consumer.DEMOS.幂等注解;

import com.chenl.consumer.feign.ProFeign;
import com.chenl.proextend.web.ResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@Slf4j
@RequestMapping("/test2")
public class IdempotentController {

    @Autowired
    ProFeign proFeign;

    Map<String,Object> map =new HashMap<>();

    @PostMapping("/test")
    public ResultDTO test() throws Exception {
        for (int i = 0; i < 3; i++) {
            UserInfo userInfo = new UserInfo();
            userInfo.setPhone("232313");
            userInfo.setName("陈列");
            String test = proFeign.test(new UserInfo());
            System.out.println(test);

        }
        return ResultDTO.ok("678");
    }
}